# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=moony.lv2
pkgver=0.40.0
pkgrel=2
pkgdesc="Easily add realtime programmable logic glue in LV2 plugin graphs"
arch=(loong64 x86_64)
url="https://git.open-music-kontrollers.ch/~hp/moony.lv2"
license=(Artistic2.0)
groups=(
  lv2-plugins
  pro-audio
)
depends=(
  glibc
  libglvnd
  libx11
  lv2-host
)
makedepends=(
  glew
  glu
  libvterm
  lv2
  meson
  sord
)
checkdepends=(lv2lint)
source=(
  $pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz
  $pkgname-$pkgver.tar.gz.asc::$url/archive/$pkgver.tar.gz.asc
)
sha512sums=('8f59dbac3a6c542f9d224eddb3652351cfa2a1e94ab8bda3b8fb77395625b5af544fd977b7550f128fdc4f252ef2502c1505651b568c440a8473111dde1d5120'
            'SKIP')
b2sums=('92bce9bfef2b3060e8ca0cff0705612d6be0d2bbef4a7688fb85fe1c420feea87d38af582db7bb1a5b0237eccdac7c5ee196ff6adf2599f4578e19f43b1296a3'
        'SKIP')
validpgpkeys=('5AE26CEBBF49705C19FB273A30258F99258CB76A') # Hanspeter Portner <dev@open-music-kontrollers.ch>

prepare() {
  # NOTE: copying things in place as out-of-tree build is otherwise broken
  cp -a $pkgname-$pkgver/manual .
  printf "%s\n" "$pkgver" > VERSION
}

build() {
  arch-meson build $pkgname-$pkgver
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends+=(
    glew libGLEW.so
  )

  meson install -C build --destdir "$pkgdir"
  # docs
  install -vDm 644 $pkgname-$pkgver/{ChangeLog,README.md} -t "$pkgdir/usr/share/doc/$pkgname/"
}
